import datetime  # noqa: D100
from dataclasses import dataclass
from typing import Optional


@dataclass
class CommitLog:
    """存储提交记录，支持多实例."""

    id: str
    git_instance: str
    repository_id: int
    created_at: datetime.datetime
    additions: int = 0
    deletions: int = 0
    total_changes: int = 0
    commit_type: int = 1
    branch_id: Optional[str] = None
    email: Optional[str] = None
    committer_fullname: Optional[str] = None
    message: Optional[str] = None
    web_url: Optional[str] = None
    updated_at: Optional[datetime.datetime] = None
